import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

export default new Router({
  // beforeRouteEnter (to, from, next){
  //   console.log('fwaf');
  //   this.$store.commit('setHeadShow',true);
  //   next();
  // },
  routes: [{
      path: '/',
      name: 'Home',
      component: () => import('@/components/login/index')
    },
    {
      path: '/planList',
      name: 'planList',
      component: () => import('@/components/plan/list/index')
    },
    {
      path: '/crowdsList',
      name: 'crowdsList',
      component: () => import('@/components/plan/list-crowds/index')
    },
    {
      path: '/adgroupList',
      name: 'adgroupList',
      component: () => import('@/components/plan/list-adgroup/index')
    },
    {
      path: '/add_plan',
      name: 'AddPlan',
      component: () => import('@/components/plan/add/index'),
      children: [{
          path: '',
          name: 'baseMsg',
          component: () => import('@/components/plan/add/base-msg/index'),
        },   
        {
          path: 'baseMsg',
          name: 'baseMsg',
          component: () => import('@/components/plan/add/base-msg/index'),
        },
        {
          path: 'setunit',
          name: 'SetUnit',
          component: () => import('@/components/plan/add/unit-msg/index'),
        },
        {
          path: 'setCreative',
          name: 'setCreative',
          component: () => import('@/components/plan/add/creative-msg/index'),
        }
        
      ]
    },
    {
      path: '/calendar',
      name: 'calendar',
      component: () => import('@/components/calendar/index')
    },
    {
      path: '/creativity',
      name: 'creativity',
      component: () => import('@/components/creativity/index') 
    },
    {
      path:'/check-creative',
      name:'checkCreative',
      component:()=>import('@/components/creativity/check-creative/index')
    },
    {
      path:'/login',
      name:'login',
      component: () => import('@/components/login/index') 
    },
    {
      path: '/time-slider',
      name: 'timeSlider',
      component: () => import('@/components/time-slider/index')
    },
    {
      path: '/time_slot',
      name: 'TimeSlot',
      component: () => import('@/components/time-slot/index')
    },
    {
      path:'/areas-tem',
      name:'areasTem',
      component: () => import('@/components/areas-tem/index')
    }
  ]
})
